{extend name="layout/main-block" /}

<!-- main content start -->
{block name="content"}
<section id="main-content">
    <section class="wrapper">
        <div class="row">
            <ol class="breadcrumb">
                <li class="h4"><a href="">分类管理</a></li>
                <li class="h4">index</li>
            </ol>
        </div>
        <div class="row col-sm-1" style="margin-bottom: 20px;">
            <a href="{:url('nav/create')}" class="btn btn-primary" role="button">添加一级分类</a>
        </div>
        <div class="row content-main">
            <div class="col-sm-12">
                <form action="">
                    <table class="table table-striped">
                        <tr>
                            <th>id</th>
                            <th>导航栏名称</th>
                            <th>操作</th>
                        </tr>
                        <!--一层循环-->
                        {volist name="nav" id="v" empty="$empty" }
                        <tr>
                            <td>{$v.nav_id}</td>
                            <td>{$v.nav_name_cn}</td>
                            <td>
                                <a href="{:url('nav/create', ['id'=>$v.nav_id])}">新建子级</a>
                                <a href="{:url('nav/update', ['id'=>$v.nav_id])}">修改</a>
                                <a href="{:url('nav/delete', ['id'=>$v.nav_id])}" onclick="return confirm('确定要删除吗？');">删除</a>
                            </td>
                        </tr>
                        <!--//判断子级是否为空，二层循环-->
                        {notempty name="$v.child"}
                        {volist name="$v.child" id="v2"}
                        <tr>
                            <td>--&nbsp;&nbsp;{$v2.nav_id}</td>
                            <td>--&nbsp;&nbsp;{$v2.nav_name_cn}</td>
                            <td>
                                <a href="{:url('nav/create', ['id'=>$v2.nav_id])}">新建子级</a>
                                <a href="{:url('nav/update', ['id'=>$v2.nav_id])}">修改</a>
                                <a href="{:url('nav/delete', ['id'=>$v2.nav_id])}" onclick="return confirm('确定要删除吗？');">删除</a>
                            </td>
                        </tr>
                            <!--//判断子级是否为空，三层循环-->
                            {notempty name="$v2.child"}
                            {volist name="$v2.child" id="v3"}
                            <tr>
                                <td>--&nbsp;&nbsp;--&nbsp;&nbsp;{$v3.nav_id}</td>
                                <td>--&nbsp;&nbsp;--&nbsp;&nbsp;{$v3.nav_name_cn}</td>
                                <td>
                                    <a href="{:url('nav/create', ['id'=>$v3.nav_id])}">新建子级</a>
                                    <a href="{:url('nav/update', ['id'=>$v3.nav_id])}">修改</a>
                                    <a href="{:url('nav/delete', ['id'=>$v3.nav_id])}" onclick="return confirm('确定要删除吗？');">删除</a>
                                </td>
                            </tr>
                                <!--//判断子级是否为空，四层循环-->
                                {notempty name="$v3.child"}
                                {volist name="$v3.child" id="v4"}
                                <tr>
                                    <td>--&nbsp;&nbsp;--&nbsp;&nbsp;--&nbsp;&nbsp;--&nbsp;&nbsp;{$v4.nav_id}</td>
                                    <td>--&nbsp;&nbsp;--&nbsp;&nbsp;--&nbsp;&nbsp;--&nbsp;&nbsp;{$v4.nav_name_cn}</td>
                                    <td>
                                        <a href="{:url('nav/create', ['id'=>$v4.nav_id])}">新建子级</a>
                                        <a href="{:url('nav/update', ['id'=>$v4.nav_id])}">修改</a>
                                        <a href="{:url('nav/delete', ['id'=>$v4.nav_id])}" onclick="return confirm('确定要删除吗？');">删除</a>
                                    </td>
                                </tr>
                                {/volist}
                                {/notempty}
                            {/volist}
                            {/notempty}
                        {/volist}
                        {/notempty}
                        {/volist}
                    </table>
                </form>
            </div>
        </div>
    </section>
</section>
{/block}